<template xmlns:v-bind="http://www.w3.org/1999/xhtml">
  <div class="mbox">
    <a v-bind:href="'#/content/'+item.id" target="_blank" v-bind:title="item.title">
      <div class="mposter">
        <img v-bind:src="imageBase" v-bind:alt="item.title">
      </div>
      <div class="mdetail">
        <div class="mtitle" :title="item.title">
          {{item.title}}
        </div>
        <div class="mtime">
          {{item.beginOn}}
        </div>
        <div class="mplace">
          {{item.place}}
        </div>
        <div class="mprice">
          {{item.minPrice}}
          <span class="price-unit">元起</span>
        </div>
      </div>
    </a>
  </div>
</template>

<script>
  export default {
    props: ["item"],
    data() {
      return {
        imageBase: ''
      }
    },
    beforeMount() {
      this.$axios({
        method: 'get',
        url: `/api/image/${this.item.poster}`,
      }).then((res) => {
        this.imageBase = res.data.imageBase;
      })
    }
  };
</script>

<style lang="css" scoped>
  .mbox {
    width: 320px;
    padding-right: 20px;
    float: left;
    color: #000000;
  }

  .mposter {
    padding-right: 12px;
    padding-left: 10px;
    vertical-align: top;
    display: inline-block;
  }

  .mposter img {
    border-radius: 5px;
    width: 130px;
    height: 180px;
  }

  .mdetail {
    margin-top: 2px;
    width: 140px;
    display: inline-block;
    vertical-align: top;
    overflow: hidden;
  }

  .mtitle {
    font-size: 14px;
    line-height: 20px;
    height: 40px;
    color: #494949;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 18px;
    text-align: left;
  }

  .mtime,.mplace {
    font-size: 14px;
    line-height: 20px;
    color: #888;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
  }

  .mprice {
    color: #fd6857;
    font-size: 20px;
    font-weight: 700;
    margin-top: 20px;
    line-height: 25px;
  }

  .mprice > span {
    font-size: 14px;
    font-weight: 400;
  }
</style>

